package com.fun.object;

/**
 * 猜猜输出啥，深入理解类的加载机制哦
 */
public class SingleClass {

    public static int count1;
    public static int count2=0;
    private static SingleClass instance=new SingleClass();
    private SingleClass(){
        count1++;
        count2++;
    }

    public static SingleClass getInstance(){
        return instance;
    }

    public static void main(String[] args){
        SingleClass singleClass= SingleClass.getInstance();
        System.out.println(singleClass.count1);
        System.out.println(singleClass.count2);
    }

}
